import request from '@/utils/request'
// 检查老人请假状态
export function checkElderlyLeaveStatus(elderlyId) {
  return request({
    url: '/le/request/checkLeaveStatus/' + elderlyId,
    method: 'get'
  })
}

// 根据老人ID和状态查询请假记录
export function listByElderlyAndStatus(query) {
  return request({
    url: '/le/request/listByElderlyAndStatus',
    method: 'get',
    params: query
  })
}
// 新增接口：根据老人ID查询单条完整信息（适配后端新增的/selectById/{elderlyId}）
export function getElderlyByElderlyId(elderlyId) {
  return request({
    url: '/le/elderly/selectById/' + elderlyId,
    method: 'get'
  })
}
// 查询老人管理列表
export function selectElderlySelectList(query) {
  return request({
    url: '/le/elderly/selectList',
    method: 'get',
    params: query
  })
}
// 查询老人管理列表
export function listElderly(query) {
  return request({
    url: '/le/elderly/list',
    method: 'get',
    params: query
  })
}

// 查询老人管理详细
export function getElderly(id) {
  return request({
    url: '/le/elderly/' + id,
    method: 'get'
  })
}
// 查询老人联查详细
export function getElderlyAll(id) {
  return request({
    url: '/le/elderly/list/' + id,
    method: 'get'
  })
}

// 新增老人管理
export function addElderly(data) {
  return request({
    url: '/le/elderly',
    method: 'post',
    data: data
  })
}

// 修改老人管理
export function updateElderly(data) {
  return request({
    url: '/le/elderly',
    method: 'put',
    data: data
  })
}

// 删除老人管理
export function delElderly(id) {
  return request({
    url: '/le/elderly/' + id,
    method: 'delete'
  })
}
